// pages/member/feedback.js
var req = require('../../interfaceImpl.js');
var config = require('../../interfaceConfig.js');
var app = getApp();
var content = '';
Page({
    llbInput: function (e) {
        content = e.detail.value
    },
    feedback: function () {
        var that = this;
        if (content == '') {
            setTimeout(function () {
                wx.showToast({
                    title: '反馈不能为空！',
                    image: '/static/images/cuo.png',
                    duration: 1500
                })
            }, 100)
        } else {
            this.setData({ flag: true })
            wx.showLoading({
                title: '请稍候', mask: true
            })
            req.FeedBack(content, app.globalData.token).then(res => {
                console.log(res)
                if  (res.data.success){
                    wx.showModal({
                        title: '提交成功',
                        content: "非常感谢您的反馈",
                        showCancel: false,
                        success: function (res) {
                            wx.navigateBack({ changed: false });
                        }
                    })
                    that.setData({ flag: false })
                }
                else{
                    wx.showModal({
                        title: '提交失败',
                        content: res.data.data,
                        showCancel: false,
                        success: function (res) {
                        }
                    })
                    that.setData({ flag: false })
                }
                wx.hideLoading();
            })
        }
    }
})